package com.estar.assistsurvy.thread;

import com.estar.assistsurvy.constant.Constants;
import com.estar.assistsurvy.entity.RequestGetMessage;
import com.estar.assistsurvy.entity.ResponseQueryMessage;

import android.content.Context;
import android.os.Handler;
import android.util.Log;

public class GetMessageListThread extends BaseThread {

	private RequestGetMessage getMessages;

	public GetMessageListThread(Context context, Handler handler, RequestGetMessage getMessages) {
		super(context, handler);
		this.getMessages = getMessages;
	}
	
	@Override
	public void run() {
		// TODO Auto-generated method stub
		url_str=Constants.NAMESPACE+Constants.PLATFORMMESSAGE;
		json=gson.toJson(getMessages);
		postRequest(url_str, json);
		if(result!=null){
			Log.i("wl", "获取平台信使列表页返回值"+result);
			ResponseQueryMessage queryMessage=new ResponseQueryMessage();
			queryMessage=gson.fromJson(result, ResponseQueryMessage.class);
			
			msg.what=0;
			msg.obj=queryMessage;
			msg.sendToTarget();
		}
	}
	
}
